LUA CALL FUNCTION
Calls a script function and returns 0 if no error has occurred. Before calling a script function you first have to use the LUA PUSH FUNCTION command. Then you can push any arguments the function needs, and then you may call the function with this command.
The reason for this procedure is the fact that a script function can have various arguments and it is impossible to map them all to function definitions. So LUA has implemented the stack to make it possible to virtually call ANY script function with arbitrary arguments that you may make up.
The arguments are needed to tell LUA how many function arguments you have pushed on the stack, and how many result values the script function will push on the stack upon completion. LUA will remove all stack elements relevant to the function call.
After the script function has completed, the results of the function (if any) are pushed on the stack, ready for you to pop.
You can get more help on the LUA stack on the official LUA homepage: http://www.lua.org
SYNTAX
Return Integer=LUA CALL FUNCTION(num_arguments as Integer, num_results as Integer)
RELATED INFO
LUA command menu
Index
EXAMPLE
Showcase-example 1
Showcase-example 2